﻿using System.Collections.Generic;
using Library.OrmEnterpriseEntity.TableInfo;

namespace Library.OrmEnterpriseEntity {
	/// <summary>
	/// Base wrap class for statement class
	/// </summary>
	public abstract class StatementWrapper {
		internal protected readonly QueryStatement Statement;
		protected StatementWrapper(QueryStatement statement) {
			Statement = statement;
		}
		/// <summary>
		/// Get table alias for specific table
		/// </summary>
		/// <param name="dbTable"></param>
		/// <returns></returns>
		public string TableAlias(DbTableView dbTable) {
			return Statement.TableAlias(dbTable);
		}
		/// <summary>
		/// Get where clause of statement
		/// </summary>
		/// <returns></returns>
		public QueryExpBuilder WhereClause() {
			return Statement.GetWhereAtBuild();
		}
		/// <summary>
		/// Get parameter of statement
		/// </summary>
		public ICollection<QueryParameter> Parameters {
			get { return Statement.Parameters; }
		}
	}
}
